package com.ccb.sc.groupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ccb.sc.groupon.vo.AppGrouponListVo;
import com.ccb.sc.groupon.vo.GrouponLogListVo;
import com.ccb.sc.common.modules.groupon.entity.Groupon;
import com.ccb.sc.common.modules.groupon.entity.GrouponLog;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.ibatis.annotations.Param;

/**
 * @author ken
 * @version 1.0
 * @date 2020-09-21
 */
public interface AppGrouponMapper extends BaseMapper<Groupon> {

    Page<AppGrouponListVo> selectByQueryParam(Page<Groupon> page, @Param("params") QueryParam params);

    Page<GrouponLogListVo> selectRecords(Page<GrouponLog> page, @Param("memberId") Long memberId);

    Page<GrouponLogListVo> selectInviteRecords(Page<GrouponLog> page, @Param("memberId") Long memberId);

    @Data
    @Accessors(chain = true)
    class QueryParam {

        private Long categoryId;

        private String key;
    }
}
